In the design of electronic circuits, periodic waveform signals are often required for purposes including clocked computer and control circuits, communication circuits requiring pulses, and test and measurement circuits. The present invention relates to circuits which supply periodic waveform signals. More specifically, the present invention relates to using a switched-capacitor feedback loop to bias a variable oscillator so that it produces an accurate and stable periodic waveform.
There are a few popular options available for generating a periodic waveform. Low-cost RC (resistor-capacitor) oscillators can be built using discrete components such as comparators, resistors, and capacitors, or using simple integrated circuits such as the industry standard 555 timer in conjunction with several discrete components. These solutions are bulky and inaccurate, especially at frequencies greater than a few hundred kilohertz.
On the other hand, accurate oscillators may be built using ceramic resonators or crystals as a stable frequency element. However, these circuits are also bulky and tend to be more expensive than RC oscillators. It is difficult or impossible to vary their frequency, as they are usually available only in preset frequencies. A phase-locked loop circuit may be used to generate a range of frequencies at increased cost. There is a need for a circuit that combines the frequency stability of a ceramic resonator with the low-cost, flexibility, and ease-of-use of an RC oscillator, while requiring less space than either.
A simple RC oscillator circuit will suffer from poor initial accuracy and stability over supply and temperature. In addition, these circuits usually have poor linearity when operated over a largexe2x80x94e.g., 10:1xe2x80x94frequency range.
There are two ways to improve the accuracy. Open-loop techniques involve using very fast comparators, accurate voltage references, and linearity correction circuits that attempt to predict and correct for the inherent non-linearity of the basic circuit. The performance of such a circuit is fundamentally limited by the number of circuit elements, each contributing a certain amount of error to the oscillation frequency.
Closed-loop, or feedback, techniques place the basic oscillator circuit inside a high-gain feedback loop that suppresses the oscillator""s inaccuracies. The accuracy is substantially determined by the feedback path, which may consist of much fewer devices. Feedback techniques, often using op-amps are popular because they change the critical components from one part of the circuit to another of the designer""s choosing. In the case of an RC oscillator, the accuracy of the basic oscillator circuit can be neglected. Proper design of the feedback and input circuits will results in an overall design that can be much more accurate, stable, and linear than possible using open-loop techniques.
The feedback circuit must convert frequency into another type of signal for comparison against an accurate reference. A switched-capacitor is an excellent candidate for use in a feedback circuit because it can act as a xe2x80x9cfrequency-controlled resistorxe2x80x9d with value R=1/(f*C). Placing a controlled voltage (VREF) across the switched-capacitor allows it to generate an average current that is proportional to frequency (IFREQ). This current may be subtracted from a reference current (IREF) to generate an error current. This error current is used to adjust the oscillator frequency by changing its input (either voltage or current). If the feedback loop can force the error current to zero, then the frequency will be equal to IREF/(C*VREF).
One way to process the error current is to integrate it across a second capacitor, creating a voltage that may be used as input to the oscillator. In switched-capacitor circuits, it is common to implement an integrator with an op-amp that places the second capacitor in a negative feedback loop between the op-amp output and its negative input. Because an op-amp forces the voltage between its inputs to near zero, this circuit allows the switched-capacitor voltage to be set by applying the proper voltage at the op-amp""s positive input.
The switched-capacitor current will not be continuous, but will instead transfer packets of charge each clock cycle. While its average current is IFREQ=f*C*VREF, the charge transfer occurs at discrete points in time unlike a true resistor. Therefore, the voltage at the output of the op-amp will be a sawtooth waveform, with near-instantaneous jumps in voltage once each clock cycle, and a continuous ramp due to IREF in between.
A switched capacitor feedback loop used in conjunction with an integrating amplifier circuit is described in T. R. Viswanathan et al., xe2x80x9cSwitched-Capacitor Frequency Control Loop,xe2x80x9d IEEE J. of Solid-State Circuits, 17(4):774-778 (August 1982) (xe2x80x9cViswanathanxe2x80x9d).
FIG. 1 shows the architecture of the switched capacitor frequency control loop described by Viswanathan. An oscillator circuit 100 includes a voltage reference 130, which is used to supply a current through a resistor 112 (R) to an inverting input of an amplifier circuit 120. Amplifier circuit 120 includes an inverting feedback loop with a capacitor 116 acting as an integrator.
A two-phase clock generator 124 provides clock signal 126 and clock signal 128 which exhibit a 180xc2x0 phase difference from each other. When clock signal 126 is high, switches 104 and 106 are closed; when clock signal 126 is low, switches 104 and 106 are open. When clock signal 128 is high, switches 102 and 110 are closed; when clock signal 128 is low, switches 102 and 110 are open. The overall effect of switches 126 and 128 is to alternately couple and de-couple a switched capacitor 108 (C) from amplifier circuit 120 and voltage reference 130.
The coupling and de-coupling of switched capacitor 108 removes a charge packet from the inverting input of amplifier circuit 120 every clock cycle. The combination of the current flowing through resistor 112 and the periodic switching of switched capacitor 108 provides a signal at the output of amplifier circuit 120 resembling a sawtooth waveform. At a certain frequency given by f=1/(R*C), the amount of charge removed in a single cycle by the switched capacitor is equal to the accumulated charge added by the resistor in the same amount of time. If the switched-capacitor is operated at that frequency, the average value of the sawtooth waveform at the op-amp output will not change over time. At higher frequencies, the average switched-capacitor current is greater and the average value of the op-amp output rises. Likewise, at lower frequencies, the average value of the op-amp output voltage falls.
FIG. 1 also shows a loop filter 122 which is coupled between amplifier circuit 120 and a suitable VCO (Voltage Controlled Oscillator) 118. Loop filter 122 averages the output of the integrating amplifier for use as input to VCO 118. By averaging the output, the loop filer 122 determines the frequency of the periodic waveform VCO 118 produces. Two-phase clock generator 124 generates the switched-capacitor clocks 126 and 128 based on the VCO output. This completes the feedback loop, as the switched-capacitor current is determined by the VCO frequency.
Viswanathan further acknowledges that resistor 112 may be replaced by any suitable current source, creating a current-to-frequency converter. Similarly, applying two different voltage references to the resistor and switched capacitor causes an analog-to-digital conversion of voltages based on time or frequency measurement.
An alternative architecture with a switched capacitor loop is described by Asad A. Abidi, xe2x80x9cLinearization of Voltage-Controlled Oscillators Using Switched-Capacitor Feedback,xe2x80x9d IEEE J. of Solid-State Circuits, 22(3):494-496 (June 1987) (xe2x80x9cAbidixe2x80x9d) which is shown in FIG. 2.
An oscillator circuit 200 shown in FIG. 2 includes an amplifier circuit 208 configured in an inverting integrating amplifier configuration with a capacitor 206. A voltage reference 202 (V2)is coupled to an inverting input of amplifier circuit 208 through a resistor 204 (R).
FIG. 2 also shows a switched capacitor frequency control loop with a VCO 220 controlling a switched capacitor 216 (C) by opening and closing switches 210 and 212. Switches 210 and 212 are controlled by oscillating signals 222 and 224 from VCO 220, in a similar fashion to Viswanathan""s circuit, to periodically couple switched capacitor 216 to the inverting input of amplifier circuit 208. The amount of charge transferred by switched capacitor 216 is proportional to the change in differential voltage across switched capacitor 216. This change is the difference between voltage reference 214 (V1) and the voltage at the inverting input of amplifier circuit 208.
Abidi""s implementation places different voltages across switched capacitor 216 and resistor 204, a variation that was included in Viswanathan""s paper. This voltage difference leads to the inclusion of voltage references 202 (V2) and 214 (V1), in the steady-state frequency f for oscillator circuit 200, where f=V2/(C*R*V1) The additional terms contributing to the steady-state frequency add more complexity to the building of an oscillator circuit with an accurate frequency.
Error is introduced to Abidi""s oscillator circuit by the offset error voltage of the op-amp. Furthermore, during the ramping portion of the op-amp""s sawtooth output, a small voltage must be developed across the op-amp inputs, creating another xe2x80x9ceffectivexe2x80x9d offset voltage. The magnitude of this voltage is dependent on the gain-bandwidth product of the op-amp and the ramp slew rate, which increases with smaller values of frequency-setting resistor. This voltage difference also creates error in the output frequency.
Further error is introduced into Viswanathan""s and Abidi""s oscillator circuits by the discrete changes in the circuits"" output voltages. When the switched capacitor is coupled to the op-amp""s inverting input, it will cause a nearly instantaneous change in the op-amp""s output that is equal to the change in capacitor voltage times the ratio of the switched-capacitor to the integrating capacitor. If the change in the switched capacitor""s voltage is xcex94Vin, then the change in the op-amp""s output voltage will be xcex94Vout=xcex94Vin*(Csw/Cint). During this change in output, the negative input deviates from its steady-state value by nearly xcex94Vin, then recover at a rate determined by the op-amp""s gain-bandwidth product. During this recovery time, the current flowing through the resistor is in error. The cumulative effect of this process is an error in the charge transferred through the resistor during each clock cycle.
Another source of error to the oscillator circuit is the user""s inadvertent introduction of capacitance to the oscillator circuit in the overall integration of the user""s electronic circuit. Viswanathan""s and Abidi""s oscillator circuits do not address the issue of capacitance introduced by the user to the oscillator circuit. While stray capacitance in an op-amp circuit can sometimes cause the circuit to be unstable, a different problem may occur in these oscillator circuits. If the parasitic capacitance on the op-amp input is of a similar size to the integrating capacitor, it will reduce the bandwidth of the op-amp circuit. This may prevent the circuit from settling quickly enough after the switched-capacitor is attached to the inverting input, creating an error. Since Abidi""s and Viswanathan""s circuits are not integrated, it is unlikely that this would be a problem because a large integrating capacitor could be used. However, in a monolithic integrated circuit, the maximum capacitance is quite limited. A user of such an integrated circuit could accumulate excess capacitance from the printed circuit board.
Furthermore, Viswanathan""s and Abidi""s oscillator circuits are not very practical. First, because they are not integrated circuits, they require a large amount of physical space for the various components. Second, achieving high accuracy requires costly accurate components. In particular, very accurate capacitors are expensive components, while accurate resistors are much more affordable. It would be desirable to provide a variable frequency oscillator circuit utilizing a switched-capacitor feedback loop to minimize the inaccuracy of a typical oscillator.
It would also be desirable to provide an input to the oscillator circuit whereby the user may couple a resistor to the oscillator circuit. The resistor""s value would determine with high accuracy the output frequency of the oscillator circuit. This input should be robust against capacitance to make the circuit easy to use.
Finally, it would be desirable to provide a monolithic integrated circuit which implements the oscillator circuit, reducing the circuit size and making it practical for use in a wide array of applications.
It is an object of the present invention to provide a variable frequency oscillator circuit utilizing a switched-capacitor feedback loop to minimize the inaccuracy of a typical oscillator.
It is also an object of the present invention to provide an input to the oscillator circuit whereby the user may couple a resistor to the oscillator circuit. The resistor""s value would determine with high accuracy the output frequency of the oscillator circuit. This input should be robust against capacitance to make the circuit easy to use.
Finally, it is an object of the invention to provide a monolithic integrated circuit which implements the oscillator circuit, reducing the circuit size and making it practical for use in a wide array of applications.
An oscillator circuit which provides an oscillating output signal with an integrating amplifier circuit is provided. The amplifier circuit is coupled to the switched capacitor and also coupled to a user input which is adapted for coupling to a power supply through a frequency-setting resistor. The amplifier circuit provides an output waveform which can be converted to the oscillating output signal in a number of suitable of ways.
The frequency-setting resistor preferably sets the frequency of the output waveform and the oscillating signal. The waveform and the oscillating signal preferably are proportional to one another. Switches are coupled to the switched capacitor that control the coupling of the switched capacitor to the amplifier circuit. The switches are controlled by the oscillating output signal.
The oscillator circuit includes a controllable current sourcexe2x80x94e.g., a precision current mirrorxe2x80x94to preferably copy the input resistor current to an input of the amplifier circuit. The oscillator circuit also preferably includes a suitable VCO (Voltage Controlled Oscillator) that is adapted to provide the oscillating signal based on the output waveform. The VCO may be controlled by an output of a sample-hold circuit where the sample-hold circuit is coupled to receive the output waveform.